home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / blitzbasic / riblitzlibs.lha / riblitzlibs / gfx / GFXTest.asc < prev   
Text File  |  2002-02-02  |  1KB  |  79 lines

  1. ;GFX library (C)1994 Reflective Images
  2. ;Example program
  3. ;By Stephen McNamara
  4. ;Please feel free to use any part of the program
  5. ; in whatever way you feel like
  6.  
  7. ;Open a screen
  8. Screen 0,0,0,320,200,5,0,"GFX-Library Example Program",2,1
  9.  
  10. ;Set up our palette with some dummy colours
  11. For h.l=0 To 15
  12.   PalRGB 0,h,h,h,h
  13.   PalRGB 0,h+16,h,h,0
  14. Next h
  15.  
  16. ;But keep our screens default colours
  17. For h=0 To 3
  18.   PalRGB 0,h,Red(h),Green(h),Blue(h)
  19. Next h
  20.  
  21. ;Get a bitmap to use from the screen
  22. ScreensBitMap 0,0
  23. Use BitMap 0
  24. BitMapOutput 0
  25.  
  26. ;And draw some rubbish
  27. y=12
  28. For h=1 To 31
  29.   Boxf 0,y,319,y+4,h
  30.   y+5
  31. Next h
  32.  
  33. ;Use our palette on the screen
  34. Use Palette 0
  35.  
  36. ;And make our library use the palette
  37. PaletteInfo 0
  38.  
  39. Locate 0,23 : NPrint "Values    :"
  40. Locate 0,24 : NPrint "AGA values:"
  41.  
  42. ;Loop until you press the mouse button
  43. Repeat
  44.   VWait
  45.  
  46.   ;get our mouse coordinates
  47.   xm.w=SMouseX
  48.   ym.w=SMouseY
  49.  
  50.   ;get the colour under the mouse pointer
  51.   cl.w=Point(xm,ym)
  52.  
  53.   ;Print our colour values
  54.   Locate 12,23
  55.   Print "R:"+Str$(PalRed(cl))+" G:"+Str$(PalGreen(cl))+" B:"+Str$(PalBlue(cl))+"         "
  56.   Locate 12,24
  57.   Print "R:"+Str$(AGAPalRed(cl))+" G:"+Str$(AGAPalGreen(cl))+" B:"+Str$(AGAPalBlue(cl))+"        "
  58. Until Joyb(0)
  59.  
  60. ;Do a nice palette fade using palettes 0 and 1
  61.  
  62. ;Set up palette 1 to have 32 colours
  63. PalRGB 1,31,0,0,0
  64.  
  65. ;DO the fade!
  66. For ratio.q=1 To 0 Step -0.01
  67.   PalAdjust 1,ratio
  68.   Use Palette 1
  69.   VWait
  70. Next ratio
  71.  
  72. VWait 25
  73. End
  74.  
  75.  
  76.  
  77.  
  78.  
  79.